package com.qfedu.zy.controllers;

import com.qfedu.zy.pojos.Item;
import com.qfedu.zy.services.impl.iItemServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/item")
public class ItemController {

    @Autowired
    private iItemServiceImpl iItemService;

    @RequestMapping("list.do")
    public String dolist(Model model){
        List<Item> items = iItemService.query();
        model.addAttribute("items",items);
        return "/index.jsp";
    }
}
